﻿using UnityEngine;
using System.Collections;

public class _HealthManager : MonoBehaviour
{
	public float healAmount = 10;
	public float healthMax;
	private float currentHealth;
	
	void Start()
	{
		currentHealth = healthMax;
	}
	
	public void TakeDamage(float damage)
	{
		if(currentHealth > 0.0f)
		{
			currentHealth -= damage;
		}
	}
	
	public void GetHealth(float heal)
	{
		currentHealth += heal;

		if(currentHealth > healthMax)
		{
			currentHealth = healthMax;
		}
	}
	
	public bool IsAlive()
	{
		return (currentHealth > 0.0f);
	}
}
